//  服务器端
const path = require('path');
const nodeExternals = require('webpack-node-externals');
const merge = require('webpack-merge')
const config = require('./webpack.base.js')

const serverConfig = {
  target:'node',  //  打包的时候不用打包Nodejs的原生包
  mode:'development',
  entry:'./src/server/index.js',
  output:{
    filename:'bundle.js',
    path:path.resolve(__dirname,'build')
  },
  externals:[nodeExternals()]
}

module.exports = merge(config,serverConfig)